﻿<!-- 
News Framework
(C) Tanzim Saqib. Oct 25, 2010.
http://TanzimSaqib.com | http://www.promotiontoyou.com
-->
    
<UserControl x:Class="TanzimSaqib.NewsFramework.MainPanorama"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    xmlns:fx="clr-namespace:TanzimSaqib.NewsFramework;assembly=TanzimSaqib.NewsFramework" 
    fx:Command.Attach="Loaded=MainPanorama_Load"
    Background="{Binding BackgroundImageSource}"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.DataContext>
        <fx:MainPanoramaViewModel />
    </UserControl.DataContext>

    <controls:Panorama fx:Command.Attach="Loaded=LoadPanorama">
    	<controls:Panorama.Background>
    		<ImageBrush Stretch="Fill" ImageSource="/Views/6.png"/>
    	</controls:Panorama.Background>

        <controls:Panorama.Title>
            <StackPanel Orientation="Horizontal" Margin="0,80,0,0">
                <Image x:Name="icon" Source="/ApplicationIcon.png" Height="51" Width="51" Margin="0,0,10,0"/>
                <TextBlock Text="{Binding PageTitle}" FontStyle="Italic" FontFamily="Segoe WP Bold" FontSize="20" VerticalAlignment="Center"/>
            </StackPanel>
        </controls:Panorama.Title>

        <!--Panorama item two-->
        <!--Use 'Orientation="Horizontal"' to enable a panel that lays out horizontally-->
        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center" Text="Promotions"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with image placeholder and text wrapping-->
            <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Latest}" fx:Command.Attach="SelectionChanged=Latest_SelectionChanged" Foreground="{x:Null}">
            	<ListBox.Background>
            		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            			<GradientStop Color="#CCC5FAF2" Offset="0"/>
            			<GradientStop Color="#CCFACECE" Offset="1"/>
            		</LinearGradientBrush>
            	</ListBox.Background>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="0,0,0,30" Width="450">
                            <!--Replace rectangle with image-->
                            <Image Source="{Binding LineTwo}" Height="80" Width="80" />
                            <!-- <Rectangle Height="100" Width="100" Fill="#FFE5001b" /> -->
                            <StackPanel Width="370">
                                <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" Foreground="#FF071E53"/>
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </controls:PanoramaItem>

        <!--Panorama item one-->

        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="My favourite" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with image placeholder and text wrapping-->
            <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Saved}" fx:Command.Attach="SelectionChanged=Saved_SelectionChanged">
            	<ListBox.Background>
            		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            			<GradientStop Color="#CCD2B0B0" Offset="0"/>
            			<GradientStop Color="#CCF5F7B9" Offset="1"/>
            		</LinearGradientBrush>
            	</ListBox.Background>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="0,0,0,30" Width="450">
                            <!--Replace rectangle with image-->
                            <Image Source="{Binding LineTwo}" Height="80" Width="80" />
                            <!-- <Rectangle Height="100" Width="100" Fill="#FFE5001b" /> -->
                            <StackPanel Width="450">
                                <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" Foreground="#FF03133A"/>
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </controls:PanoramaItem>

        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="search" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with text wrapping-->
            <StackPanel>
                <TextBox Text="{Binding SearchText}" fx:Command.Attach="TextChanged=SearchText_TextChanged" />
                <Button Content="Search" fx:Command.Attach="Click=Search_Click" IsEnabled="{Binding CanSearch}" />
            </StackPanel>
        </controls:PanoramaItem>

        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="about" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with text wrapping-->
            <StackPanel Background="#CC000000" VerticalAlignment="Top" Height="338">
                <TextBlock TextWrapping="Wrap" Text="Promotion 2U." Foreground="White" FontSize="24"/>
                <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="24"><Run Text="This Windows Phone 7 application is develop by the permission of Microsoft Innovation Center - Bangkok. It is a framework on which RSS based www.promotiontoyou.com"/><LineBreak/><Run/><LineBreak/><Run Text="For more information, please contact:"/></TextBlock>
                <Button Content="amii-berry@hotmail.com" fx:Command.Attach="Click=VisitHomePage" FontSize="24" Foreground="White" Height="74" />

            </StackPanel>
        </controls:PanoramaItem>

    </controls:Panorama>

    <!--Panorama-based applications should not show an ApplicationBar-->
</UserControl>
